package com.yilin.tms.user.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yilin.tms.core.application.PageData;
import com.yilin.tms.core.entity.user.account.Account;
import com.yilin.tms.core.entity.user.UserType;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author 作者
 * @since 2022-10-19
 */
@Mapper
@Repository
public interface AccountMapper extends BaseMapper<Account> {

    /**
     * 推送：根据User类型获取推送ID集
     */
    List<String> getPushIdListByUserType(UserType type);

    /**
     * 推送：获取所有推送ID集
     */
    List<String> getPushIdList();

    /**
     * 根据用户类型获取pushIds
     */
    List<String> getPushIdsByUserType(@Param("loginUser") Account loginUser, @Param("userType") UserType userType);

    /**
     * 获取所有子集用户列表
     */
    PageData<Account> getAccountChildPage(@Param("page")PageData<Object> page, @Param("query") Account query);

    List<Account> getLogicAccountByPhone(@Param("phone")String phone);

    void recoveryById(@Param("accountId")String accountId);
}
